# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=pyexfil
pkgver=84.0297b46
pkgrel=7
groups=('blackarch' 'blackarch-networking')
pkgdesc='A couple of beta stage tools for data exfiltration.'
arch=('any')
url='https://github.com/ytisf/PyExfil'
license=('MIT')
depends=('python' 'impacket' 'python-requests' 'python-progressbar'
         'python-numpy' 'python-pillow' 'python-pytube3' 'python-pycryptodome'
         'python-pycryptodomex' 'python-qrcode' 'python-base58' 'python-librosa'
         'python-luhn' 'python-names' 'python-faker')
makedepends=('git' 'python-setuptools')
source=("$pkgname::git+https://github.com/ytisf/PyExfil.git"
        '__init__.py.patch')
sha512sums=('SKIP'
            'c5fcd35f6e8b2c2ab1c3726979cb6eb1f90fb009dd6bc12f32589cfc633dc667f18d0b4bee061c86998bd16ae7b689de98ca4039397b5fd79e84690f933b6290')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  patch -p1 < __init__.py.patch
}

build() {
  cd $pkgname

  python setup.py build
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/share/$pkgname"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md \
    DOCUMENTATION.md
}

